cll: Adding unix pipe support

Today I’ve added a little feature to my cll tool (which I renamed again but I think now I’ll stick to this) so that it can process stdin so that you can do stuff like this:

echo 'a presentation about the friends plugin for wordpress' | cgt -s 'Please create a reveal.js presentation based on the following notes. Ensure to use short titles and short few words on each list item. Please load the moon theme and scripts from the cdn.jsdelivr.net domain, dont use any reveal.js plugins. Respond with just the HTML, no outside comments.' > presentation.html

Which creates a presentation.html file that contains a full Reveal.js presentation on the topic.

The systems prompt will tell the model how to behave so that you can also (granted it doesn’t always work but it’s gotten better) tell it to output JSON which you can then parse:

echo hello | cll -mllama2 -s 'please respond only in valid json' | jq .
{
  "message": "hello",
  "type": "text"
}

In “stdin mode,” it will only output the response from the LLM, you can turn that back on using -v (as in verbose) although that additional output will go to stderr.

Leave a Reply

Only people in my network can comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.